//
//  BaseRequest.m
//  fashionbuyer
//
//  Created by ale tan on 2018/1/16.
//  Copyright © 2018年 ale tan. All rights reserved.
//

#import "BaseRequest.h"

@implementation BaseRequest

- (id)init
{
    self = [super init];
    if (self) {
        _parameters = [NSMutableDictionary dictionary];
        _needToken = NO;
        _needUID = NO;
    }
    return self;
}

- (void)sendRequest
{
    // 在子类实现
}

- (void)setNeedToken:(BOOL)needToken{
    _needToken = needToken;
    if (needToken) {
        NSString *token = [[NSUserDefaults standardUserDefaults] valueForKey:@"token"];
        
        [self.parameters setValue:token forKey:@"access_token"];
        
    }
}

- (void)setNeedUID:(BOOL)needUID{
    _needUID = needUID;
    if (needUID) {
       NSString *uid = [[NSUserDefaults standardUserDefaults] valueForKey:@"token"];
        [self.parameters setValue:uid forKey:@"uid"];
    }
}

@end
